<%--
  Created by IntelliJ IDEA.
  User: focus
  Date: 2018/1/8
  Time: 20:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="../base.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
    <meta name="renderer" content="webkit" />
    <title>${article.title} - WeCenter 社交化问答社区程序</title>
    <meta name="keywords" content="${article.title}" />
    <meta name="description" content=""  />
    <link href="css/default/img/favicon.ico?v=20160523" rel="shortcut icon" type="image/x-icon" />
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="css/icon.css" />
    <link href="css/default/common.css?v=20160523" rel="stylesheet" type="text/css" />
    <link href="css/default/link.css?v=20160523" rel="stylesheet" type="text/css" />
    <link href="js/plug_module/style.css?v=20160523" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        var _5F41941505DA16CF765125822040A7D4="929985360dee05f85b48d128ad40f58c";
        var G_POST_HASH=_5F41941505DA16CF765125822040A7D4;
        var G_INDEX_SCRIPT = "";
        var G_SITE_NAME = "WeCenter 社交化问答社区程序";
        var G_BASE_URL = "http://wenda.wecenter.com";
        var G_STATIC_URL = "http://wenda.wecenter.com/static";
        var G_UPLOAD_URL = "http://wenda.wecenter.com/uploads";
        var G_USER_ID = "41635";
        var G_USER_NAME = "FOCUS";
        var G_UPLOAD_ENABLE = "Y";
        var G_UNREAD_NOTIFICATION = 0;
        var G_NOTIFICATION_INTERVAL = 100000;
        var G_CAN_CREATE_TOPIC = "";
        var G_ADVANCED_EDITOR_ENABLE = "Y";
        var FILE_TYPES = "jpg,jpeg,png,zip,rar,7z";
    </script>

    <script src="js/jquery.2.js?v=20160523" type="text/javascript"></script>
    <script src="js/jquery.form.js?v=20160523" type="text/javascript"></script>
    <script src="js/plug_module/plug-in_module.js?v=20160523" type="text/javascript"></script>
    <script src="js/aws.js?v=20160523" type="text/javascript"></script>
    <script src="js/aw_template.js?v=20160523" type="text/javascript"></script>
    <script src="js/app.js?v=20160523" type="text/javascript"></script>
    <script type="text/javascript" src="js/compatibility.js"></script>
    <!--[if lte IE 8]>
    <script type="text/javascript" src="js/respond.js"></script>
    <![endif]-->
</head>
<noscript unselectable="on" id="noscript">
    <div class="aw-404 aw-404-wrap container">
        <img src="common/no-js.jpg">
        <p>你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!</p>
    </div>
</noscript>
<body>
<%@ include file="../common/header.jsp"%>
<div class="aw-container-wrap">
    <div class="container">
        <div class="row">
            <div class="aw-content-wrap clearfix">
                <div class="col-sm-12 col-md-9 aw-main-content aw-article-content">
                    <div class="aw-mod aw-topic-bar" id="question_topic_editor" data-type="article" data-id="1507">
                        <div class="tag-bar clearfix">
                            <!--话题-->
                            <c:forEach var="t" items="${article.involvedTopics}">
                                <span class="topic-tag" data-id="${t.id}">
                                    <a class="text" href="topic/${t.id}">${t.topicName}</a>
                                </span>
                            </c:forEach>
                        </div>
                    </div>
                    <div class="aw-mod aw-question-detail">
                        <div class="mod-head">
                            <h1>${article.title}</h1>
                        </div>
                        <div class="mod-body">
                            <div class="content markitup-box">
                                ${article.content}
                            </div>
                            <div class="meta clearfix">
                                <span class="pull-right  more-operate">
                                    <em class="text-color-999"><fmt:formatDate value="${article.createTime}" pattern="yyyy-MM-dd" /></em>
                                </span>
                            </div>
                        </div>
                    </div>
                    <!-- 文章评论 -->
                    <div class="aw-mod">
                        <div class="mod-head common-head">
                            <h2>${article.commentCount} 个评论</h2>
                        </div>

                        <div class="mod-body aw-feed-list">
                            <c:forEach var="c" items="${article.comments}">
                            <div class="aw-item" id="answer_list_${c.id}">
                                <div class="mod-head">
                                    <a class="aw-user-img aw-border-radius-5" href="user/${c.createUser.username}">
                                        <img src="http://wenda.wecenter.com/uploads/avatar/000/00/68/72_avatar_mid.jpg" alt="${c.createUser.username}" />
                                    </a>
                                    <p>
                                        <a href="user/${c.createUser.username}">${c.createUser.username}</a>
                                    </p>
                                </div>
                                <div class="mod-body">
                                    <div class="markitup-box">${c.content}</div>
                                </div>
                                <div class="mod-footer">
                                    <div class="meta">
                                        <span class="pull-right text-color-999"><fmt:formatDate value="${c.createTime}" pattern="yyyy-MM-dd HH:mm" /> </span>
                                        <a class="aw-article-comment text-color-999" data-id="6872"><i class="icon icon-comment"></i> 回复</a>
                                    </div>
                                </div>
                            </div>
                            </c:forEach>
                        </div>
                    </div>
                    <!-- end 文章评论 -->

                    <!-- 回复编辑器 -->
                    <c:if test="${sessionScope._current_user eq null}">
                    <div class="aw-mod aw-article-replay-box">
                        <a name="answer_form"></a>
                        <p align="center">要回复文章请先<a href="http://wenda.wecenter.com/account/login/">登录</a>或<a href="http://wenda.wecenter.com/account/register/">注册</a></p>
                    </div>
                    </c:if>
                    <c:if test="${sessionScope._current_user ne null}">
                    <div class="aw-mod aw-article-replay-box">
                        <a name="answer_form"></a>
                        <form action="article/ajax/save_comment/" onsubmit="return false;" method="post" id="answer_form">
                            <input type="hidden" name="articleID" value="${article.id}" />
                            <div class="mod-head">
                                <a href="user/${user.username}" class="aw-user-name"><img alt="${user.username}" src="http://wenda.wecenter.com/uploads/avatar/000/04/16/35_avatar_mid.jpg" /></a>
                            </div>
                            <div class="mod-body">
                                <textarea rows="3" name="content" id="comment_editor" class="form-control autosize" placeholder="写下你的评论..."></textarea>
                            </div>
                            <div class="mod-footer clearfix">
                                <a href="javascript:" onclick="AWS.ajax_post($('#answer_form'), AWS.ajax_processer, 'reply');" class="btn btn-normal btn-success pull-right btn-submit btn-reply">回复</a>
                            </div>
                        </form>
                    </div>
                    </c:if>
                    <!-- end 回复编辑器 -->
                </div>
                <!-- 侧边栏 -->
                <div class="col-sm-12 col-md-3 aw-side-bar hidden-sm hidden-xs">
                    <!-- 发起人 -->
                    <div class="aw-mod user-detail">
                        <div class="mod-head">
                            <h3>${article.createUser.username}</h3>
                        </div>
                        <div class="mod-body">
                            <dl>
                                <dt class="pull-left aw-border-radius-5">
                                    <a href="people/${article.createUser.username}"><img alt="kenw2004" src="http://wenda.wecenter.com/uploads/avatar/000/02/00/67_avatar_mid.jpg" /></a>
                                </dt>
                                <dd class="pull-left">
                                    <a class="aw-user-name" href="people/${article.createUser.username}" data-id="${article.createUser.id}">${article.createUser.username}</a>
                                    <a class="icon-inverse follow tooltips icon icon-plus " onclick="AWS.User.follow($(this), 'user', ${article.createUser.id});"></a>
                                    <p>${article.createUser.introduction}</p>
                                </dd>
                            </dl>
                        </div>
                    </div>
                    <!-- end 发起人 -->
                </div>
                <!-- end 侧边栏 -->
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    var ANSWER_EDIT_TIME = 640000;
    $(document).ready(function () {
        if ($('.aw-article-vote.disabled').length)
        {
            $('.aw-article-vote.disabled a').attr('onclick', '');
        }
        AWS.at_user_lists('#wmd-input');

        AWS.Init.init_article_comment_box($('.aw-article-comment'));
    });
</script>

<a class="aw-back-top hidden-xs" href="javascript:;" onclick="$.scrollTo(1, 600, {queue:true});"><i class="icon icon-up"></i></a>
<div id="aw-ajax-box" class="aw-ajax-box"></div>
</body>
</html>